part of 'component.dart';

class MenuItemView extends StatelessWidget {
  const MenuItemView(
      {Key? key,
      required this.icon,
      required this.title,
      this.color,
      this.padding,
      this.width,
      this.height,
      this.newsCount = 0,
      this.spacing,
      this.onTap})
      : super(key: key);
  final Widget icon;
  final Widget title;
  final EdgeInsetsGeometry? padding;
  final VoidCallback? onTap;
  final double? width;
  final double? height;
  final double? spacing;
  final int newsCount;
  final Color? color;
  @override
  Widget build(BuildContext context) {
    return InkWell(
      onTap: onTap,
      child: Container(
        color: color,
        padding: padding,
        width: width,
        height: height,
        child: Column(
          mainAxisAlignment: MainAxisAlignment.center,
          children: [
            icon,
            SizedBox(
              height: spacing ?? 10.r,
            ),
            title
          ],
        ),
      ),
    );
  }
}

class UIButton extends StatelessWidget {
  const UIButton(
      {Key? key,
      required this.icon,
      required this.title,
      this.color,
      this.padding,
      this.width,
      this.height,
      this.newsCount = 0,
      this.spacing,
      this.onTap})
      : super(key: key);
  final Widget icon;
  final Widget title;
  final EdgeInsetsGeometry? padding;
  final VoidCallback? onTap;
  final double? width;
  final double? height;
  final double? spacing;
  final int newsCount;
  final Color? color;
  @override
  Widget build(BuildContext context) {
    return InkWell(
      onTap: onTap,
      child: Container(
        color: color,
        padding: padding,
        width: width,
        height: height,
        child: Row(
          mainAxisAlignment: MainAxisAlignment.center,
          mainAxisSize: MainAxisSize.min,
          crossAxisAlignment: CrossAxisAlignment.center,
          children: [
            icon,
            SizedBox(
              width: spacing ?? 3.r,
            ),
            title
          ],
        ),
      ),
    );
  }
}

class MenuItem {
  late String icon;
  late String title;
  int? idx;
  Function()? onTap;
}
